// $codepro.audit.disable
//M5 project for CS 2340
//Team 9

import java.awt.EventQueue;

import javax.swing.JFrame;
import javax.swing.JButton;
import javax.swing.JPanel;
import java.awt.GridBagLayout;
import java.awt.GridBagConstraints;
import java.awt.Insets;
import java.awt.FlowLayout;
import java.awt.BorderLayout;
import javax.swing.JLabel;
import javax.swing.AbstractAction;
import java.awt.event.ActionEvent;
import javax.swing.Action;
import java.awt.event.ActionListener;

/**
 * Class to generate the patient GUI
 * 
 * @author Team 9
 * @version 1.0
 * 
 */
public class patient_panel {
	/**
	 * constant value 100
	 */
	private static final int HUNDRED = 100;

	/**
	 * constant value 450
	 */
	private static final int FOURFIFTY = 450;

	/**
	 * constant value 300
	 */
	private static final int THREEHUNDRED = 300;

	/**
	 * constant value 5
	 */
	private static final int FIVE = 5;

	/**
	 * constant value 2
	 */
	private static final int TWO = 2;

	/**
	 * constant value 4
	 */
	private static final int FOUR = 4;

	/**
	 * constant value 3
	 */
	private static final int THREE = 3;

	@Override
	public String toString() {
		return "patient_panel [getClass()=" + getClass() + ", hashCode()="
				+ hashCode() + ", toString()=" + super.toString() + "]";
	}

	/**
	 * JFrame to hold the patient panel together
	 */
	private JFrame frame;

	/**
	 * JLabel for the GUI holding the name
	 */
	private JLabel txtNamename;

	/**
	 * JLabel for the GUI holding the date of birth
	 */
	private JLabel txtDobdob;

	/**
	 * JLabel for the GUI holding the email
	 */
	private JLabel txtEmailEmailemailcom;
	private final Action action = new SwingAction();
	private final Action action_1 = new SwingAction_1();
	private final Action action_2 = new SwingAction_2();

	public JFrame getFrame() {
		return frame;
	}

	public void setFrame(JFrame frame) {
		this.frame = frame;
	}

	/**
	 * Launch the application.
	 */
	public static void main(String[] args) {
		EventQueue.invokeLater(new Runnable() {
			public void run() {
				try {
					final patient_panel window = new patient_panel();
					window.frame.setVisible(true);
				} catch (Exception e) {
					e.printStackTrace();
				}
			}
		});
	}

	/**
	 * Create the application.
	 */
	public patient_panel() {
		initialize();
	}

	/**
	 * Initialize the contents of the frame.
	 */
	private void initialize() {
		frame = new JFrame();
		frame.setBounds(HUNDRED, HUNDRED, FOURFIFTY, THREEHUNDRED);
		frame.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);
		frame.getContentPane().setLayout(new BorderLayout(0, 0));

		final JPanel panel = new JPanel();
		frame.getContentPane().add(panel, BorderLayout.NORTH);
		panel.setLayout(new FlowLayout(FlowLayout.CENTER, FIVE, FIVE));

		final JButton btnAppointments = new JButton("Appointments");
		btnAppointments.addActionListener(new ActionListener() {
			public void actionPerformed(ActionEvent arg0) {
				btnAppointments.setText("bacon");
			}
		});
		btnAppointments.setAction(action);
		panel.add(btnAppointments);

		final JButton btnHistory = new JButton("History");
		btnHistory.addActionListener(new ActionListener() {
			public void actionPerformed(ActionEvent arg0) {
				btnHistory.setText("bacon");
			}
		});
		btnHistory.setAction(action_1);
		panel.add(btnHistory);

		final JButton btnLogout = new JButton("Logout");
		btnLogout.addActionListener(new ActionListener() {
			public void actionPerformed(ActionEvent arg0) {
				btnLogout.setText("bacon");
			}
		});
		btnLogout.setAction(action_2);
		panel.add(btnLogout);

		final JPanel panel_4 = new JPanel();
		frame.getContentPane().add(panel_4, BorderLayout.CENTER);
		final GridBagLayout gbl_panel_4 = new GridBagLayout();
		gbl_panel_4.columnWidths = new int[] { 0, 0, 0, 0, 0 };
		gbl_panel_4.rowHeights = new int[] { 0, 0, 0, 0, 0, 0 };
		gbl_panel_4.columnWeights = new double[] { 0.0, 0.0, 0.0, 1.0,
				Double.MIN_VALUE };
		gbl_panel_4.rowWeights = new double[] { 0.0, 0.0, 0.0, 0.0, 0.0,
				Double.MIN_VALUE };
		panel_4.setLayout(gbl_panel_4);

		txtNamename = new JLabel();
		txtNamename.setText("Name: /name");
		final GridBagConstraints gbc_txtNamename = new GridBagConstraints();
		gbc_txtNamename.insets = new Insets(0, 0, FIVE, 0);
		gbc_txtNamename.fill = GridBagConstraints.HORIZONTAL;
		gbc_txtNamename.gridx = THREE;
		gbc_txtNamename.gridy = TWO;
		panel_4.add(txtNamename, gbc_txtNamename);

		txtDobdob = new JLabel();
		txtDobdob.setText("DOB: /DOB");
		final GridBagConstraints gbc_txtDobdob = new GridBagConstraints();
		gbc_txtDobdob.insets = new Insets(0, 0, FIVE, 0);
		gbc_txtDobdob.fill = GridBagConstraints.HORIZONTAL;
		gbc_txtDobdob.gridx = THREE;
		gbc_txtDobdob.gridy = THREE;
		panel_4.add(txtDobdob, gbc_txtDobdob);

		txtEmailEmailemailcom = new JLabel();
		txtEmailEmailemailcom.setText("Email: email@email.com");
		final GridBagConstraints gbc_txtEmailEmailemailcom = new GridBagConstraints();
		gbc_txtEmailEmailemailcom.fill = GridBagConstraints.HORIZONTAL;
		gbc_txtEmailEmailemailcom.gridx = THREE;
		gbc_txtEmailEmailemailcom.gridy = FOUR;
		panel_4.add(txtEmailEmailemailcom, gbc_txtEmailEmailemailcom);
	}

	private class SwingAction extends AbstractAction {
		public SwingAction() {
			putValue(NAME, "Appointments");
			putValue(SHORT_DESCRIPTION, "Some short description");
		}

		public void actionPerformed(ActionEvent e) {
		}
	}

	private class SwingAction_1 extends AbstractAction {
		public SwingAction_1() {
			putValue(NAME, "History");
			putValue(SHORT_DESCRIPTION, "Some short description");
		}

		public void actionPerformed(ActionEvent e) {
		}
	}

	private class SwingAction_2 extends AbstractAction {
		public SwingAction_2() {
			putValue(NAME, "Log Out");
			putValue(SHORT_DESCRIPTION, "Some short description");
		}

		public void actionPerformed(ActionEvent e) {
		}
	}
}
